/**
 * Created by Administrator on 2016/6/21.
 */
import React from 'react';
import styles from '../../style.css';

class LikeButton extends React.Component{
  constructor(props) {
    super(props);
    this.state = {liked: false};
  }
  handleClick(){
    this.setState({liked: !this.state.liked});
  }
  render() {
    var text = this.state.liked ? 'like' : 'haven\'t liked';
    return (
      <p onClick={()=>this.handleClick()}>
        You {text} this. Click to toggle.
      </p>
    );
  }
}

export default class Example3 extends React.Component{
  render() {
    return (
      <div className={styles.app}>
        <LikeButton />
      </div>
    )
  }
}